﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageRole.aspx.cs" Inherits="CocisWeb.admin.ManageRole" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
 <link href="../css/cont.css" rel="stylesheet" type="text/css" />
    <meta content="MSHTML 6.00.2900.5848" name="GENERATOR" />
    <script  type="text/javascript">
    function checkAdd()
    {
        var names = document.getElementById("TextBoxNames");
        

        if (names.value == "") {
            alert('请输入新增角色名称！');
            names.focus();
            return false;
        }
        else 
        {
             return true;
               
 
        }
    }

    function checkUpdate() {
        var id = document.getElementById("TextBoxDeptId");
        var names = document.getElementById("TextBoxNames");
        

        if (id.value == "") {
            alert('请选择要修改的角色！');
            return false;

        }
        else {
            if (names.value == "") {
                alert('请输入新的角色名称！');
                names.focus();
                return false;
            }
            else {                
                    return true;              


            }

        }
    }

    function checkDelete() 
    {
        var id=document.getElementById("TextBoxDeptId");       
        if(id.value=="")
        {
            alert('请选择要删除的角色！');              
               return false;
        
        }
        else 
        {
              if (confirm('确认要删除吗？')) 
              {
                return true;
              }
              else
              {                    
                  return false;                   
              }
        

        }

    }
    
    
    
    
    </script>
</head>
<body style="padding-left:5px;padding-right:5px;background-image:url(../images/bg.gif);	background-repeat:repeat-x;">
 <form id="form1" runat="server">
 
  <table style="height:100%; width:100%;" border="0px" cellpadding="0px" cellspacing="0px">
  <tr style="background-image: url(../images/bg_header.gif); background-repeat: repeat-x; height:47px">
  <td style="width:10px;background-image: url(../images/main_hl.gif);"></td>
  <td>
      <span style="padding-right: 10px; padding-left: 10px; float: left; background-image: url(../images/main_hb.gif); line-height:47px; color: white; background-repeat: repeat-x; height: 47px; text-align: center;">
      Role Management<strong>
      </strong>
      </span>
  </td>
  <td style="background-image: url(../images/main_hr2.gif);width:10px"></td>
  </tr>
  <tr>
  <td style="background-image: url(../images/main_ls.gif)"></td>
  <td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; color: #566984; padding-top:10px; background-color: white;">
      <br />
        &nbsp;Role Name：<asp:TextBox ID="TextBoxNames"  runat="server" Width="150px"></asp:TextBox>&nbsp;Role Desc：<asp:TextBox 
          ID="TextBox1" runat="server" Width="243px"></asp:TextBox>
                <asp:Button ID="btnAdd" runat="server" OnClientClick="javascript:if(checkAdd()){return true;}else{return false;}"
            Text="ADD" CssClass="button_normal" onclick="btnAdd_Click" />     

                <br />
      <br />

        <asp:GridView ID="gvRole" runat="server" AutoGenerateColumns="False"
            Height="30px" 
                            onrowdatabound="gvRole_RowDataBound" PageSize="15" 
          DataKeyNames="roleId" onrowcancelingedit="gvRole_RowCancelingEdit" 
          onrowdeleting="gvRole_RowDeleting" onrowediting="gvRole_RowEditing" 
          onrowupdating="gvRole_RowUpdating">
            <Columns>
                <asp:BoundField DataField="roleId" HeaderText="RoleNo" ReadOnly="True" >
                    <ItemStyle Width="70px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Role Name">
                    <ItemTemplate>
                        <asp:Label ID="lbRoleName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"RoleName") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtName" Text='<%# DataBinder.Eval(Container.DataItem,"RoleName") %>' runat="server" Width="100px"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle Width="120px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Role Description">
                    <ItemTemplate>
                        <asp:Label ID="lbRoleDesc" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"RoleDesc") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDesc" runat="server" Width="170px" Text='<%# DataBinder.Eval(Container.DataItem,"RoleDesc") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle Width="190px" />
                </asp:TemplateField>
                <asp:CommandField HeaderText="Update" ShowEditButton="True" CancelText="Cancel" 
                    DeleteText="Delete" EditText="Edit" UpdateText="Update">
                    <ItemStyle Width="80px" />
                </asp:CommandField>
                <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" CancelText="Cancel" DeleteText="Delete" EditText="Edit" UpdateText="Update">
                    <ItemStyle Width="80px" />
                </asp:CommandField>
            </Columns>
            <EmptyDataTemplate>
                <div>
                    ………………</div>
            </EmptyDataTemplate>
            <HeaderStyle CssClass="datagrid_headrstyle_normal" />
            <PagerSettings FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" 
                Mode="NextPreviousFirstLast" PreviousPageText="上一页" 
                FirstPageImageUrl="~/images/main_54.gif" 
                LastPageImageUrl="~/images/main_60.gif" NextPageImageUrl="~/images/main_58.gif" 
                PreviousPageImageUrl="~/images/main_56.gif" />
            <FooterStyle CssClass="datagrid_footerstyle_normal" Height="20px" />
            <RowStyle HorizontalAlign="Center" Height="19px" />
            
        </asp:GridView>
      <br />
      <br />
      
      <br />
      </td>
  <td style="background-image: url(../images/main_rs.gif)"></td>
  </tr>
  </table>
  </form>
</body>
</html>
